home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / wtj208.zip / ZEMPEL / SOURCE / THUNKVB / VBARRAY.FRM (.txt) < prev    next >
Visual Basic Form  |  1993-05-08  |  6KB  |  202 lines

  1. frmVBArray
  2. Thunking with Huge VB Arrays
  3. Form2
  4. txAnswer
  5. txOffset
  6. cmdSumArray
  7. Sum the Array
  8. txVBUT
  9. txVBLinear
  10. txVBHandle
  11. cmdMakeArray
  12. Rebuild VB Array (ReDim)
  13. txValElemt
  14. txNumElemts
  15. Label11
  16. And VB can still use it.
  17. Label10
  18. $VB Allocates Memory, Win32s uses it!
  19. Label8
  20. Put your 32 bit Function Here!
  21. MS Sans Serif
  22. Label9
  23. (Do First)
  24. Label7
  25. Answer
  26. Label6
  27. +Offset between W3.1 and Win32 linear Spaces
  28. Label5
  29. Win32s Linear Address
  30. Label4
  31. Win 3.1 Linear Address
  32. Label3
  33. VBArray Memory Handle
  34. Label2
  35. Value of Each Element
  36. Label1
  37. Number of Array Elements
  38. Line1
  39.     Form_Loadf
  40. Label1_Click
  41. Text1_Change
  42. NumberElements
  43. Text1C
  44. TextS
  45. bigArray
  46. Command1_Click^
  47. MakeArray_Click
  48. Text2_Change2
  49. NumElemts_Change
  50. NumElements
  51. ValElement-
  52.     NumElemtsv
  53. TxBoxValElemts_ChangeT
  54. txBoxValElemts
  55. txBoxNumElemtsV
  56. Label2_Click
  57. TxBoxNumElemts_Change;
  58. Form_Click(
  59. MB_OK
  60. MB_OKCANCELh
  61. MB_YESNOCANCEL
  62. MB_YESNO
  63. MB_ICONSTOP
  64. MB_ICONQUESTION
  65. MB_ICONEXCLAMATION
  66. MB_ICONINFORMATIONA
  67. MB_DEFBUTTON2
  68. IDYES
  69. DgDef
  70. Response
  71. Title
  72. have_
  73. machiney
  74. elsIf
  75. ColumnsB
  76. h0ffff
  77. Leftover
  78. ArrSize
  79.     ArrayRows
  80.     ArraySize8
  81. ArrColumns
  82. ArrRows
  83.     lpVBArrayw
  84. VBPTRtoLong
  85. Numbersp
  86. VBSel
  87.     lhvbarray
  88. GlobalHandle
  89. hVBArray
  90.     VBLowWord
  91.     GlobalFix
  92. GetSelectorBase
  93. UTSelectorOffSetToLinear
  94. Win31Linear
  95. WIN32LinearJ
  96. OffSet
  97. GlobalUnFix
  98. Text2
  99. text3>
  100. VBLinearAddress|
  101. linearaddress
  102. Text5
  103.     UTAddressM
  104. VBUTAddress<
  105. Text6
  106. Text7L
  107. dwgetAddressForInteger
  108. dwgetAddressForLong)
  109. sVBArray
  110. dwDWORDto2Integers
  111. jlpVBArray
  112. jVBSelT
  113. jlhvbarray
  114.     jhVBArray
  115.     sVBArray2>
  116. OutLoop
  117.     ArratRows
  118. IfOffSet.
  119. text34
  120. text4`
  121. Label5_Click
  122. Win16Start
  123. SumArray
  124. CndSumArray_Clicku
  125. Win16Finish
  126. SumArray32
  127. Sum2K
  128. trxt[
  129. Win32Start
  130. Win32Finish
  131. Label10_Click
  132. ThenVBLinearAddress
  133.     LockArray
  134. firstElement
  135. fills
  136. memory
  137. blocks
  138. txVBHandle.
  139. txVBLinearz
  140. txVBUT
  141. txOffset
  142. txNumElemts_Change
  143. txNumElemts
  144. txValElemts_Change
  145. txValElemts
  146. Text5_Change
  147. cmdSumArray_Click
  148. txValElemt_Change:
  149. txValElemt
  150. cmdMakeArray_Click
  151. txAnswer
  152. txBoxValElemti
  153. arraycreated
  154. MessageBox
  155. OutofMem
  156. Leavesub
  157. frmVBArray
  158. timer01
  159. array
  160. unload:
  161. cmdMakeArray_Click
  162. this sub redimensions and fills a VB array
  163. then gets array linear addresses
  164. The array you requested is more than 15 MB, forget it
  165. You must have a lot of memory!
  166. This array is between 1 and 15 MB
  167. Make Big VB Array?
  168. turns off error handling
  169. fills array with value
  170. if overs 64000 bytes,r
  171. fills memory in 16,000 byte blocks
  172. This is the key code:fixing linear virtual address of VB array
  173. must get pointer to first elemento
  174. get selector from pointer 
  175. get handle from selector
  176. handle is in the low wordl
  177. fix VB array in virtual space 
  178. Win 3.1 function to get Windows3.1 linear address.
  179. UT function to get WIn32s linear address from pointeri
  180. must unfix VB Array
  181. must convert long to equivalent of dword (unsigned long int) and correct for offset of first element from selector start
  182. VB arrays do not start at the selectorse
  183. large (huge) arrays are offset an additional
  184. two bytes 
  185. same conversion for >2GB virtual addresses
  186. long to unsigned long int (equivalent) conversion for Win32s address
  187. compare Win32s address with Win3.1
  188. Out of memory, reduce size of array
  189. Array too big
  190. undefined error
  191. cmdSumArray_Click
  192. summming the array in a win32 function from VB
  193. Redim Array first
  194. get pointer to first element
  195. get selector from pointers
  196. calling 32 bit function through UT
  197. Form_Load
  198. txNumElemts_Change
  199. enter a number >0
  200. Array size
  201. txValElemt_Change
  202.